package com.ruoyi.demo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.demo.mapper.AuctionRuleMapper;
import com.ruoyi.demo.domain.AuctionRule;
import com.ruoyi.demo.service.IAuctionRuleService;

/**
 * 竞拍规则Service业务层处理
 * 
 * @author metaee
 * @date 2025-02-24
 */
@Service
public class AuctionRuleServiceImpl implements IAuctionRuleService 
{
    @Autowired
    private AuctionRuleMapper auctionRuleMapper;

    /**
     * 查询竞拍规则
     * 
     * @param ruleId 竞拍规则主键
     * @return 竞拍规则
     */
    @Override
    public AuctionRule selectAuctionRuleByRuleId(Long ruleId)
    {
        return auctionRuleMapper.selectAuctionRuleByRuleId(ruleId);
    }

    /**
     * 查询竞拍规则列表
     * 
     * @param auctionRule 竞拍规则
     * @return 竞拍规则
     */
    @Override
    public List<AuctionRule> selectAuctionRuleList(AuctionRule auctionRule)
    {
        return auctionRuleMapper.selectAuctionRuleList(auctionRule);
    }

    /**
     * 新增竞拍规则
     * 
     * @param auctionRule 竞拍规则
     * @return 结果
     */
    @Override
    public int insertAuctionRule(AuctionRule auctionRule)
    {
        auctionRule.setCreateTime(DateUtils.getNowDate());
        return auctionRuleMapper.insertAuctionRule(auctionRule);
    }

    /**
     * 修改竞拍规则
     * 
     * @param auctionRule 竞拍规则
     * @return 结果
     */
    @Override
    public int updateAuctionRule(AuctionRule auctionRule)
    {
        auctionRule.setUpdateTime(DateUtils.getNowDate());
        return auctionRuleMapper.updateAuctionRule(auctionRule);
    }

    /**
     * 批量删除竞拍规则
     * 
     * @param ruleIds 需要删除的竞拍规则主键
     * @return 结果
     */
    @Override
    public int deleteAuctionRuleByRuleIds(Long[] ruleIds)
    {
        return auctionRuleMapper.deleteAuctionRuleByRuleIds(ruleIds);
    }

    /**
     * 删除竞拍规则信息
     * 
     * @param ruleId 竞拍规则主键
     * @return 结果
     */
    @Override
    public int deleteAuctionRuleByRuleId(Long ruleId)
    {
        return auctionRuleMapper.deleteAuctionRuleByRuleId(ruleId);
    }
}
